]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
app: Remove :menu property
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 4 Oct 2018 17:20:40 +0000 (19:20 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 6 Feb 2019 17:29:15 +0000 (18:29 +0100)
It is now unused.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/624

src/shell-app.c
src/shell-app.h
src/shell-window-tracker.c

index c765800dc300b26d3fd6f8bf611a174e5cf96ce4..5a0f81d52cbcaa28254680612a2c28e2c637c712 100644 (file)
@@ -45,7 +45,6 @@ typedef struct {
   guint window_sort_stale : 1;
 
   /* See GApplication documentation */
-  GDBusMenuModel   *remote_menu;
   GtkActionMuxer   *muxer;
   char             *unique_bus_name;
   GDBusConnection  *session;
@@ -92,7 +91,6 @@ enum {
   PROP_ID,
   PROP_DBUS_ID,
   PROP_ACTION_GROUP,
-  PROP_MENU,
   PROP_APP_INFO
 };
 
@@ -131,10 +129,6 @@ shell_app_get_property (GObject    *gobject,
       if (app->running_state)
         g_value_set_object (value, app->running_state->muxer);
       break;
-    case PROP_MENU:
-      if (app->running_state)
-        g_value_set_object (value, app->running_state->remote_menu);
-      break;
     case PROP_APP_INFO:
       if (app->info)
         g_value_set_object (value, app->info);
@@ -1075,7 +1069,7 @@ _shell_app_add_window (ShellApp        *app,
   g_signal_connect (window, "notify::user-time", G_CALLBACK(shell_app_on_user_time_changed), app);
   g_signal_connect (window, "notify::skip-taskbar", G_CALLBACK(shell_app_on_skip_taskbar_changed), app);
 
-  shell_app_update_app_menu (app, window);
+  shell_app_update_app_actions (app, window);
   shell_app_ensure_busy_watch (app);
 
   if (!meta_window_is_skip_taskbar (window))
@@ -1377,8 +1371,8 @@ create_running_state (ShellApp *app)
 }
 
 void
-shell_app_update_app_menu (ShellApp   *app,
-                           MetaWindow *window)
+shell_app_update_app_actions (ShellApp   *app,
+                              MetaWindow *window)
 {
   const gchar *unique_bus_name;
 
@@ -1394,23 +1388,18 @@ shell_app_update_app_menu (ShellApp   *app,
 
   unique_bus_name = meta_window_get_gtk_unique_bus_name (window);
 
-  if (app->running_state->remote_menu == NULL ||
-      g_strcmp0 (app->running_state->unique_bus_name, unique_bus_name) != 0)
+  if (g_strcmp0 (app->running_state->unique_bus_name, unique_bus_name) != 0)
     {
       const gchar *application_object_path;
-      const gchar *app_menu_object_path;
       GDBusActionGroup *actions;
 
       application_object_path = meta_window_get_gtk_application_object_path (window);
-      app_menu_object_path = meta_window_get_gtk_app_menu_object_path (window);
 
-      if (application_object_path == NULL || app_menu_object_path == NULL || unique_bus_name == NULL)
+      if (application_object_path == NULL || unique_bus_name == NULL)
         return;
 
       g_clear_pointer (&app->running_state->unique_bus_name, g_free);
       app->running_state->unique_bus_name = g_strdup (unique_bus_name);
-      g_clear_object (&app->running_state->remote_menu);
-      app->running_state->remote_menu = g_dbus_menu_model_get (app->running_state->session, unique_bus_name, app_menu_object_path);
       actions = g_dbus_action_group_get (app->running_state->session, unique_bus_name, application_object_path);
       gtk_action_muxer_insert (app->running_state->muxer, "app", G_ACTION_GROUP (actions));
       g_object_unref (actions);
@@ -1440,11 +1429,9 @@ unref_running_state (ShellAppRunningState *state)
       g_clear_object (&state->cancellable);
     }
 
-  g_clear_object (&state->remote_menu);
   g_clear_object (&state->muxer);
   g_clear_object (&state->session);
   g_clear_pointer (&state->unique_bus_name, g_free);
-  g_clear_pointer (&state->remote_menu, g_free);
 
   g_slice_free (ShellAppRunningState, state);
 }
@@ -1572,19 +1559,6 @@ shell_app_class_init(ShellAppClass *klass)
                                                         "The action group exported by the remote application",
                                                         G_TYPE_ACTION_GROUP,
                                                         G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
-  /**
-   * ShellApp:menu:
-   *
-   * The #GMenuProxy associated with this ShellApp, if any. See the
-   * documentation of #GMenuModel for details.
-   */
-  g_object_class_install_property (gobject_class,
-                                   PROP_MENU,
-                                   g_param_spec_object ("menu",
-                                                        "Application Menu",
-                                                        "The primary menu exported by the remote application",
-                                                        G_TYPE_MENU_MODEL,
-                                                        G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
   /**
    * ShellApp:app-info:
    *
index f02f53a31e43be65faa9a9e4eab822013395747d..8a09b642dc4b8cc5871f732940b6d5edd2bdde14 100644 (file)
@@ -67,7 +67,7 @@ int shell_app_compare_by_name (ShellApp *app, ShellApp *other);
 int shell_app_compare (ShellApp *app, ShellApp *other);
 
 void shell_app_update_window_actions (ShellApp *app, MetaWindow *window);
-void shell_app_update_app_menu       (ShellApp *app, MetaWindow *window);
+void shell_app_update_app_actions    (ShellApp *app, MetaWindow *window);
 
 gboolean shell_app_get_busy          (ShellApp *app);
 
index a0ba88450db67c285302250b788798f92cebe13f..487bc9b29b4d7546113abf64337d578c3583f960 100644 (file)
@@ -474,7 +474,7 @@ update_focus_app (ShellWindowTracker *self)
   if (new_focus_app)
     {
       shell_app_update_window_actions (new_focus_app, new_focus_win);
-      shell_app_update_app_menu (new_focus_app, new_focus_win);
+      shell_app_update_app_actions (new_focus_app, new_focus_win);
     }
 
   set_focus_app (self, new_focus_app);